package com.retail.order.service;

import com.retail.common.core.domain.Result;
import com.retail.order.domain.TOrder;
import com.retail.order.dto.OrderDetailResponse;
import com.retail.order.service.impl.OrderBatchService;

import java.util.List;
import java.util.Map;

/**
 * 订单Service接口
 * 
 * @author retail
 * @date 2024-02-27
 */
public interface ITOrderService 
{
    /**
     * 查询订单
     * 
     * @param orderId 订单主键
     * @return 订单
     */
    public TOrder selectTOrderByOrderId(Long orderId);

    /**
     * 查询订单列表
     * 
     * @param tOrder 订单
     * @return 订单集合
     */
    public List<TOrder> selectTOrderList(TOrder tOrder);

    /**
     * 新增订单
     * 
     * @param tOrder 订单
     * @return 结果
     */
    public int insertTOrder(TOrder tOrder);

    /**
     * 修改订单
     * 
     * @param tOrder 订单
     * @return 结果
     */
    public int updateTOrder(TOrder tOrder);

    /**
     * 批量删除订单
     * 
     * @param orderIds 需要删除的订单主键集合
     * @return 结果
     */
    public int deleteTOrderByOrderIds(Long[] orderIds);

    /**
     * 删除订单信息
     * 
     * @param orderId 订单主键
     * @return 结果
     */
    public int deleteTOrderByOrderId(Long orderId);

    /**
     * 取消订单
     * @param orderId
     * @return
     */
    Result cancelOrder(Long orderId);

    Result updateRemake(TOrder tOrder);


    OrderDetailResponse selectByOderCode(String orderCode);


    Map<Integer, List<TOrder>> selectTOrderMergeOrderList(List<OrderBatchService.OrderRequest> orderReqs);
}
